package agenda;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.File;
import java.io.IOException;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JTextArea;
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
import javax.swing.JPanel;
import javax.swing.filechooser.FileNameExtensionFilter;
import javax.swing.table.DefaultTableModel;

/*
 * JanelaCadastraEvento.java
 *
 * Created on 10/11/2011, 13:24:54
 */

/**
 *
 * @author Brenno
 */
public class JanelaCadastrarEvento extends javax.swing.JFrame {
    /** Creates new form JanelaCadastraEvento */
    public JanelaCadastrarEvento() {
        initComponents();
        setDefaultCloseOperation(HIDE_ON_CLOSE);
        setIconImage((new ImageIcon(getClass().getResource("/agenda/logo.png")).getImage()));
        setTitle("Cadastrar de eventos");
        evento = new Evento("","","","","","");
        this.setLocationRelativeTo(null);  
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
    private void initComponents() {

    	jPanel1 = new javax.swing.JPanel();
        jLabelCadastrarEventos = new javax.swing.JLabel();
        jLabelNome = new javax.swing.JLabel();
        jLabelData = new javax.swing.JLabel();
        jLabelHorário = new javax.swing.JLabel();
        jLabelDuracao = new javax.swing.JLabel();
        jLabelContato = new javax.swing.JLabel();
        jLabelTipo = new javax.swing.JLabel();
        jTextFieldNome = new javax.swing.JTextField();
        jTextFieldTipo = new javax.swing.JTextField();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTextAreaDescricao = new javax.swing.JTextArea();
        jButtonaddTexto = new javax.swing.JButton();
        jButtonAddaudio = new javax.swing.JButton();
        jButtonSalvar = new javax.swing.JButton();
        jButtonCancelar = new javax.swing.JButton();
        jFormattedTextFieldHorario = new javax.swing.JFormattedTextField();
        jFormattedTextFieldDuracao = new javax.swing.JFormattedTextField();
        jFormattedTextFieldData = new javax.swing.JFormattedTextField();
        jButtonAddFoto = new javax.swing.JButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        Contatos = new javax.swing.JTable();
        jLabelDescricao = new javax.swing.JLabel();
        jButtonAddContato = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabelCadastrarEventos.setFont(new java.awt.Font("Monotype Corsiva", 3, 36)); // NOI18N
        jLabelCadastrarEventos.setText("Cadastrar Eventos");

        jLabelNome.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N
        jLabelNome.setText("Nome:");

        jLabelData.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N
        jLabelData.setText("Data:");

        jLabelHorário.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N
        jLabelHorário.setText("Horário:");

        jLabelDuracao.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N
        jLabelDuracao.setText("Duração:");

        jLabelDescricao.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N
        jLabelDescricao.setText("Descrição:");

        jLabelTipo.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N
        jLabelTipo.setText("Tipo:");
        jTextAreaDescricao.setColumns(20);
        jTextAreaDescricao.setRows(5);
        jScrollPane1.setViewportView(jTextAreaDescricao);
        jButtonaddTexto.setToolTipText("Adiciona anotação de texto");
        jButtonaddTexto.setIcon(new ImageIcon(getClass().getResource("/agenda/Texto.png"))); // NOI18N
        jButtonaddTexto.addActionListener(new ActionListener(){
        	public void actionPerformed(ActionEvent e) {
				final JFrame Arquivo = new JFrame("Anotação de ");
				Arquivo.setIconImage((new ImageIcon(getClass().getResource("/agenda/logo.png")).getImage()));
			    Arquivo.setLocationRelativeTo(null);  
				Arquivo.setSize(310,240);
				JPanel Painel = new JPanel();
				JLabel Nome = new JLabel("Nome");
				final JTextField nome = new JTextField(20);
				JLabel Data = new JLabel("Data");
				final JTextField data = new JTextField(20);
				JLabel Anotacao = new JLabel("Anotação");
				final JTextArea anotacao = new JTextArea();
				anotacao.setColumns(20);
		        anotacao.setRows(5);
				JButton Ok = new JButton("Ok");
				
				Ok.addActionListener(new ActionListener(){
					@Override
					public void actionPerformed(ActionEvent arg0) {
						evento.addAnotacoes(new Anotação(nome.getText(),data.getText(),anotacao.getText()));
						Arquivo.setVisible(false);
						Arquivo.dispose();
					}
					
				});
				Painel.add(Nome);Painel.add(nome);Painel.add(Data);Painel.add(data);Painel.add(Anotacao);Painel.add(anotacao);Painel.add(Ok);
				Arquivo.add(Painel);Arquivo.setVisible(true);
			}
        });
        
        jButtonAddaudio.setToolTipText("Adiciona anotação de audio");
        jButtonAddaudio.setIcon(new ImageIcon(getClass().getResource("/agenda/Audio.png"))); // NOI18N
        jButtonAddaudio.addActionListener(new ActionListener(){
			@Override
			public void actionPerformed(ActionEvent arg0) {
				final JFrame Arquivo = new JFrame("Audio");
				Arquivo.setIconImage((new ImageIcon(getClass().getResource("/agenda/logo.png")).getImage()));
			    Arquivo.setLocationRelativeTo(null);  
				Arquivo.setSize(150,190);
				JPanel Painel = new JPanel();
				JLabel Nome = new JLabel("Nome");
				final JTextField nome = new JTextField(10);
				JLabel Data = new JLabel("Data");
				final JTextField data = new JTextField(10);
				JButton arquivo = new JButton("Arquivo");
				arquivo.addActionListener(new ActionListener(){
					@Override
					public void actionPerformed(ActionEvent arg0) {
						JFileChooser fc = new JFileChooser();
						fc.setFileFilter(new FileNameExtensionFilter("MP3","mp3"));
						fc.showOpenDialog(null);
						try {
							evento.addAnotacoes(new Anotação(nome.getText(),data.getText(),fc.getSelectedFile()));
						} catch (IOException e) {
							e.printStackTrace();
						}
						Arquivo.setVisible(false);
						Arquivo.dispose();
					}
					
				});
				Painel.add(Nome);Painel.add(nome);Painel.add(Data);Painel.add(data);Painel.add(arquivo);
				Arquivo.add(Painel);Arquivo.setVisible(true);			
			}
        	
        });
        jButtonSalvar.setIcon(new ImageIcon(getClass().getResource("/agenda/ip_icon_02_Ok.png"))); // NOI18N
        jButtonSalvar.setText("Salvar");
        jButtonSalvar.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent arg0) {
				evento.setNome(jTextFieldNome.getText());
				evento.setData(jFormattedTextFieldData.getText());
				evento.setDescricao(jTextAreaDescricao.getText());
				evento.setDuracao(jFormattedTextFieldDuracao.getText());
				evento.setHorario(jFormattedTextFieldHorario.getText());
				evento.setTipo(jTextFieldTipo.getText());
				try {
					if (Agenda.ChecaChoquedeEventos(evento)) {
						Agenda.Eventos.add(evento);
					}
					else{
						final JFrame Choque = new JFrame("Choque de horário entre eventos"); 
						Choque.setSize(400, 150);
					    Choque.setLocationRelativeTo(null);  
						Choque.setDefaultCloseOperation(HIDE_ON_CLOSE);
				        Choque.setIconImage((new ImageIcon(getClass().getResource("/agenda/logo.png")).getImage()));
						JPanel JPanel = new JPanel();
						JLabel icone = new JLabel(new ImageIcon(getClass().getResource("/agenda/error.png")));
						JLabel Mensagem1 = new JLabel("Esse evento possui choque de horário com outro já existente");
						JLabel Mensagem2 = new JLabel("Deseja cadastrar o evento mesmo assim ?");
						JButton sim = new JButton("Sim");
						sim.addActionListener(new ActionListener(){
							public void actionPerformed(ActionEvent arg0) {
								Agenda.Eventos.add(evento);
								Choque.setVisible(false);
								Choque.dispose();
							}
							
						});
						JButton nao = new JButton("Não");
						nao.addActionListener(new ActionListener(){
							public void actionPerformed(ActionEvent e) {
								Choque.setVisible(false);
								Choque.dispose();
							}
							
						});
						
						JPanel.add(icone);JPanel.add(Mensagem1);JPanel.add(Mensagem2);JPanel.add(sim);JPanel.add(nao);
						Choque.add(JPanel);
						Choque.setVisible(true);
					}
				} catch (Exception e) {
					JFrame Erro = new JFrame("Erro"); 
					Erro.setSize(310, 150);
					Erro.setDefaultCloseOperation(HIDE_ON_CLOSE);
			        Erro.setIconImage((new ImageIcon(getClass().getResource("/agenda/logo.png")).getImage()));
					JPanel JPanel = new JPanel();
					JLabel icone = new JLabel(new ImageIcon(getClass().getResource("/agenda/error.png")));
					JLabel Mensagem1 = new JLabel("Erro!");
					JLabel Mensagem2 = new JLabel("O Formato da hora e da duração deve ser hh:mm");
					JLabel Mensagem3 = new JLabel("O formato da data deve ser no formato dd/mm/aa");
					JPanel.add(icone);JPanel.add(Mensagem1);JPanel.add(Mensagem2);JPanel.add(Mensagem3);
					Erro.add(JPanel);
					Erro.setVisible(true);
				}
				try {
					Arquivos.salvarObjeto(new File("eventos.dat"), Agenda.Eventos);
				} catch (Exception e) {
					e.printStackTrace();
				}
				setVisible(false);
    			dispose();
			}
			
        });

        jButtonCancelar.setIcon(new ImageIcon(getClass().getResource("/agenda/ip_icon_02_Cancel.png"))); // NOI18N
        jButtonCancelar.setText("Cancelar");
        jButtonCancelar.addActionListener(new java.awt.event.ActionListener(){
			public void actionPerformed(ActionEvent e) {
				setVisible(false);
				dispose();
			}
        	
        });

        jFormattedTextFieldHorario.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.DateFormatter(java.text.DateFormat.getTimeInstance(java.text.DateFormat.SHORT))));

        jFormattedTextFieldDuracao.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.DateFormatter(java.text.DateFormat.getTimeInstance(java.text.DateFormat.SHORT))));

        jFormattedTextFieldData.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.DateFormatter()));
        jButtonAddFoto.setToolTipText("Adiciona anotação com Foto");
        jButtonAddFoto.setIcon(new ImageIcon(getClass().getResource("/agenda/Foto.png")));
        jButtonAddFoto.addActionListener(new ActionListener(){
			@Override
			public void actionPerformed(ActionEvent e) {
				final JFrame Arquivo = new JFrame("Anotação de Foto");
				Arquivo.setIconImage((new ImageIcon(getClass().getResource("/agenda/logo.png")).getImage()));
			    Arquivo.setLocationRelativeTo(null);  
				Arquivo.setSize(150,190);
				JPanel Painel = new JPanel();
				JLabel Nome = new JLabel("Nome");
				final JTextField nome = new JTextField(10);
				JLabel Data = new JLabel("Data");
				final JTextField data = new JTextField(10);
				JButton arquivo = new JButton("Arquivo");
				arquivo.addActionListener(new ActionListener(){
					@Override
					public void actionPerformed(ActionEvent arg0) {
						JFileChooser fc = new JFileChooser();
						fc.setFileFilter(new FileNameExtensionFilter("JPG","jpg"));
						fc.showOpenDialog(null);
						try {
							evento.addAnotacoes(new Anotação(nome.getText(),data.getText(),fc.getSelectedFile()));
						} catch (IOException e) {
							e.printStackTrace();
						}
						Arquivo.setVisible(false);
						Arquivo.dispose();
					}
					
				});
				Painel.add(Nome);Painel.add(nome);Painel.add(Data);Painel.add(data);Painel.add(arquivo);
				Arquivo.add(Painel);Arquivo.setVisible(true);
			}
        });
        
        Contatos.setModel(new javax.swing.table.DefaultTableModel(
                new Object [][] {

                },
                new String [] {
                    "Nome", "Endereco", "Celular"
                }
            ) {
                boolean[] canEdit = new boolean [] {
                    false, false, false
                };

                public boolean isCellEditable(int rowIndex, int columnIndex) {
                    return canEdit [columnIndex];
                }
            });
        DefaultTableModel modelo = (DefaultTableModel) Contatos.getModel();
		for(int i=0;i<Agenda.Contatos.size();i++){
			modelo.addRow(new String[]{Agenda.Contatos.get(i).getNome(),Agenda.Contatos.get(i).getEndereco(),Agenda.Contatos.get(i).getDataDeAniversario()});
		}
		
        jScrollPane2.setViewportView(Contatos);
        
        jButtonAddContato.setText("Adicionar Contato ao evento");
        jButtonAddContato.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent arg0) {
				try{
					evento.CadastraContatos(Agenda.Contatos.get(Contatos.getSelectedRow()));
				}
				catch(Exception E){
					final JFrame Erro = new JFrame();
					Erro.setIconImage((new ImageIcon(getClass().getResource("/agenda/logo.png")).getImage()));
				    Erro.setLocationRelativeTo(null);  
					Erro.setSize(200,100);
					JPanel Painel = new JPanel();
					JLabel Mensagem = new JLabel("Selecione algum item primeiro");
					JButton Ok = new JButton("Ok");
					Ok.addActionListener(new ActionListener(){
						@Override
						public void actionPerformed(ActionEvent arg0) {
							Erro.setVisible(false);
							Erro.dispose();
						}
						
					});
					Painel.add(Mensagem);Painel.add(Ok);Erro.add(Painel);
					Erro.setVisible(true);
				}
			}
        });
        
        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(101, 101, 101)
                        .addComponent(jLabelCadastrarEventos))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabelTipo)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextFieldTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jButtonaddTexto, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jButtonAddaudio, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jButtonAddFoto, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButtonCancelar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButtonSalvar, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(27, 27, 27)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jButtonAddContato)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 475, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabelData)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jFormattedTextFieldData, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabelHorário)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jFormattedTextFieldHorario, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabelDuracao)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jFormattedTextFieldDuracao))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabelNome)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jTextFieldNome, javax.swing.GroupLayout.PREFERRED_SIZE, 434, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(215, 215, 215)
                        .addComponent(jLabelContato)))
                .addContainerGap())
            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel1Layout.createSequentialGroup()
                    .addGap(20, 20, 20)
                    .addComponent(jLabelDescricao)
                    .addContainerGap(420, Short.MAX_VALUE)))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabelCadastrarEventos, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(14, 14, 14)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelNome)
                    .addComponent(jTextFieldNome, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelData)
                    .addComponent(jFormattedTextFieldData, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelHorário)
                    .addComponent(jFormattedTextFieldHorario, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelDuracao)
                    .addComponent(jFormattedTextFieldDuracao, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelTipo)
                    .addComponent(jTextFieldTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(57, 57, 57)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabelContato)
                .addGap(1, 1, 1)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonAddContato)
                .addGap(7, 7, 7)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addGap(35, 35, 35)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jButtonCancelar, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jButtonSalvar, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(55, 55, 55))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jButtonaddTexto, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButtonAddaudio, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButtonAddFoto, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 87, Short.MAX_VALUE))
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel1Layout.createSequentialGroup()
                    .addGap(172, 172, 172)
                    .addComponent(jLabelDescricao)
                    .addContainerGap(400, Short.MAX_VALUE)))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 555, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pack();
    }// </editor-fold>                        


    // Variables declaration - do not modify                     
    private javax.swing.JTable Contatos;
    private javax.swing.JButton jButtonAddContato;
    private javax.swing.JButton jButtonAddFoto;
    private javax.swing.JButton jButtonAddaudio;
    private javax.swing.JButton jButtonCancelar;
    private javax.swing.JButton jButtonSalvar;
    private javax.swing.JButton jButtonaddTexto;
    private javax.swing.JFormattedTextField jFormattedTextFieldData;
    private javax.swing.JFormattedTextField jFormattedTextFieldDuracao;
    private javax.swing.JFormattedTextField jFormattedTextFieldHorario;
    private javax.swing.JLabel jLabelCadastrarEventos;
    private javax.swing.JLabel jLabelContato;
    private javax.swing.JLabel jLabelData;
    private javax.swing.JLabel jLabelDescricao;
    private javax.swing.JLabel jLabelDuracao;
    private javax.swing.JLabel jLabelHorário;
    private javax.swing.JLabel jLabelNome;
    private javax.swing.JLabel jLabelTipo;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JTextArea jTextAreaDescricao;
    private javax.swing.JTextField jTextFieldNome;
    private javax.swing.JTextField jTextFieldTipo;
    private final Evento evento;
    // End of variables declaration                   
    
}
